package com.us.usws.support.ext;

import com.us.usws.cache.ChannelCache;
import com.us.usws.cache.BaseDictCache;
import com.us.usws.cache.UserCache;
import com.us.usws.cache.VideoCatCache;
import com.us.usws.cache.VideoTypeExtattrCache;

public class CacheManager {

	//private static Log log = LogFactory.getFactory().getInstance(CacheManager.class);

	/**
	 * get dict cache
	 * @return
	 */
	public static BaseDictCache getDictCache() {
		return BaseDictCache.getInstance();
	}

	/**
	 * get video type extra attr cache
	 * @return
	 */
	public static VideoTypeExtattrCache getVideoTypeExtattrCache() {
		return VideoTypeExtattrCache.getInstance();
	}

	/**
	 * get user cache
	 * @return
	 */
	public static UserCache getUserCache() {
		return UserCache.getInstance();
	}

	/**
	 * video cat cache
	 * @return
	 */
	public static VideoCatCache getVideoCatCache() {
		return VideoCatCache.getInstance();
	}

	/**
	 * channel cache
	 * @return
	 */
	public static ChannelCache getChannelCache() {
		return ChannelCache.getInstance();
	}

	/**
	 * refresh all
	 */
	public static int refreshAll() {
		int cnt = 0;
		cnt += getDictCache().refresh();
		cnt += getVideoTypeExtattrCache().refresh();
		cnt += getUserCache().refresh();
		return cnt;
	}
}